<script>
Ext.onReady(function(){
    var tree = new Ext.tree.TreePanel({
        el:'tree-div',
        useArrows:true,
        autoWidth:true,
        autoHeight:true,
        autoScroll:true,
        animate:false,
        border:false,
        rootVisible:false,

        // auto create TreeLoader
        dataUrl: '${fn.link('/espirit/eap/manager/menu.data.html')}?_resultCode=$json&cascade=true&properties=id,text,leaf,cls,href,hrefTarget,children',

        root: {
            nodeType: 'async',
            text: 'Root',
            draggable:false,
            id:'source'
        }
    });

	tree.on('beforeclick', function(node){
		if (node.leaf){
			openLink(node.attributes.href, node.attributes.hrefTarget, node.attributes.text);
		}
		return false;
    });
    // render the tree
    tree.render();
    tree.getRootNode().expand();
});
</script>
<div id="tree-div" style="overflow:auto;"></div>